package ece.fr.varlet_aimez.montecarlo;

public abstract class MonteCarloAbstract {
	
	private int nSteps,  nSimulations, poolSize;
	private String CallPutFlag;
	private double S, X,  T,  r,  b,  v, resultat;
	private long debutExec, finExec;
	
	public abstract double MonteCarloStandardOption (String CallPutFlag, double S, double X, double T, double r, double b, double v, int nSteps, int nSimulations);
	
	@Override
	public String toString() {
		return "MonteCarloAbstract [nSteps=" + nSteps + ", nSimulations="
				+ nSimulations + ", CallPutFlag=" + CallPutFlag + ", S=" + S
				+ ", X=" + X + ", T=" + T + ", r=" + r + ", b=" + b + ", v="
				+ v + ", resultat=" + resultat + ", debutExec=" + debutExec
				+ ", finExec=" + finExec + "]";
	}

	public void run() {
		System.out.println(this);
		debutExec = System.currentTimeMillis();
		resultat = 0;
		resultat = MonteCarloStandardOption(CallPutFlag, S, X, T, r, b, v, nSteps, nSimulations);
	    finExec = System.currentTimeMillis();
	}
	/**
	 * 
	 * @return le temps d'execution en milisecondes
	 */
	public long dureeCalcul(){
		return (finExec-debutExec);
	}
	
	public int getnSteps() {
		return nSteps;
	}

	public void setnSteps(int nSteps) {
		this.nSteps = nSteps;
	}

	public int getnSimulations() {
		return nSimulations;
	}

	public void setnSimulations(int nSimulations) {
		this.nSimulations = nSimulations;
	}

	public String getCallPutFlag() {
		return CallPutFlag;
	}

	public void setCallPutFlag(String callPutFlag) {
		CallPutFlag = callPutFlag;
	}

	public double getS() {
		return S;
	}

	public void setS(double s) {
		S = s;
	}

	public double getX() {
		return X;
	}

	public void setX(double x) {
		X = x;
	}

	public double getT() {
		return T;
	}

	public void setT(double t) {
		T = t;
	}

	public double getR() {
		return r;
	}

	public void setR(double r) {
		this.r = r;
	}

	public double getB() {
		return b;
	}

	public void setB(double b) {
		this.b = b;
	}

	public double getV() {
		return v;
	}

	public void setV(double v) {
		this.v = v;
	}

	public double getResultat() {
		return resultat;
	}

	public void setResultat(double resultat) {
		this.resultat = resultat;
	}

	public long getDebutExec() {
		return debutExec;
	}

	public void setDebutExec(long debutExec) {
		this.debutExec = debutExec;
	}

	public long getFinExec() {
		return finExec;
	}

	public void setFinExec(long finExec) {
		this.finExec = finExec;
	}

	public int getPoolSize() {
		return poolSize;
	}

	public void setPoolSize(int poolSize) {
		this.poolSize = poolSize;
	}
}
